package garage

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type GarageRouter struct {
}

// InitGarageRouter 初始化 garage表 路由信息
func (s *GarageRouter) InitGarageRouter(Router *gin.RouterGroup) {
	garagesRouter := Router.Group("garages").Use(middleware.OperationRecord())
	garagesRouterWithoutRecord := Router.Group("garages")
	var garagesApi = v1.ApiGroupApp.GarageApiGroup.GarageApi
	{
		garagesRouter.POST("createGarage", garagesApi.CreateGarage)   // 新建garage表
		garagesRouter.DELETE("deleteGarage", garagesApi.DeleteGarage) // 删除garage表
		garagesRouter.DELETE("deleteGarageByIds", garagesApi.DeleteGarageByIds) // 批量删除garage表
		garagesRouter.PUT("updateGarage", garagesApi.UpdateGarage)    // 更新garage表
	}
	{
		garagesRouterWithoutRecord.GET("findGarage", garagesApi.FindGarage)        // 根据ID获取garage表
		garagesRouterWithoutRecord.GET("getGarageList", garagesApi.GetGarageList)  // 获取garage表列表
	}
}
